#include "qpointdialog.h"
#include "ui_qpointdialog.h"

QPointDialog::QPointDialog(const QPointF &pt, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::QPointDialog),
    m_point(pt),
    m_ret(0)
{
    ui->setupUi(this);
    ui->x_value->setValue(pt.x());
    ui->y_value->setValue(pt.y());
}

QPointDialog::~QPointDialog()
{
    delete ui;
}

void QPointDialog::on_okBtn_clicked()
{
    m_point.setX(ui->x_value->value());
    m_point.setY(ui->y_value->value());
    m_ret=1;
    close();
}

void QPointDialog::on_cancelBtn_clicked()
{
    close();
}

int QPointDialog::get_ret()
{
    return m_ret;
}

QPointF QPointDialog::get_point()
{
    return m_point;
}
